package itpenguin.train.mbta;

import itpenguin.train.common.GtfsRealTimeFeed;
import itpenguin.train.common.Train;

import java.io.IOException;
import java.net.URL;
import java.util.List;

import com.google.transit.realtime.GtfsRealtime.VehiclePosition;

public class Mbta extends GtfsRealTimeFeed {

	@Override
	public List<Train> getCurrentPositions() throws IOException {
		
		return  fetchFeed(new URL("http://developer.mbta.com/lib/GTRTFS/Alerts/VehiclePositions.pb"));
	}

	@Override
	protected boolean filter(VehiclePosition vp) {
		char first = vp.getTrip().getRouteId().charAt(0);
		return first != '0' && first != '1' && first != '2' && first != '3' && first != '4' 
				&& first != '5' && first != '6' && first != '7' && first != '8' && first != '9';
	}
}
